<!DOCTYPE html>
<html>
	<head>
		<title>修改信息</title>
		<meta http-equiv="Pragma" CONTENT="no-cache">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="renderer" content="webkit">

		<%include("/common/include.html"){}%>
	</head>
	<body>

<form id="bentryForm"   method="post"  enctype="multipart/form-data">
				
			
		<div class="easyui-layout" data-options="fit:true">
			
			<table id="serviceTable" class="easyui-datagrid" style="height:100%;">
		
			</table>
			<div id="service_tb" >
				日期：
				<input id="service_startTime" value='${startTime! }' class="easyui-datebox theme-textbox-radius"  data-options="editable: false"/>~
				<input id="service_endTime" value='${date(),dateFormat="yyyy-MM-dd"}' class="easyui-datebox theme-textbox-radius" data-options="editable: false"/>
					<!-- <a href="#" class="easyui-linkbutton" style="background: #00A65A;color: white;" onclick="update()">确认修改</a> -->
			</div>
		
		</div>
	
			</form>
			
			<script src="${cxt !}/sb/js/ajaxfileupload.js" type="text/javascript" charset="utf-8"></script>
		<script src="${cxt !}/sb/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				//加载数据表格
				loadServiceTable();
				$('#service_startTime').datebox({
					onSelect: function(date){
						loadServiceTable();
					}
				});
				$('#service_endTime').datebox({
					onSelect: function(date){
						loadServiceTable();
					}
				});
			});
			
			function  loadServiceTable() {	
				var startTime = $("#service_startTime").val();
				var endTime = $("#service_endTime").val();
				$('#serviceTable').datagrid({
					cls: "theme-datagrid",
					toolbar: '#service_tb',
					singleSelect: true,
					rownumbers: true, //显示序号
					pagination: true,
					pageSize: 10,
					fitColumns:true,
					url: "${cxt!}/customerInfoStatistic/lookCustomerService",
					queryParams: {
						'_query.customerIds': '${customerIds! }',
						'_query.startTime': startTime,
						'_query.endTime': endTime
					}, 
				    method: 'post',
					collapsible: true,
					columns:[[
								{field:'ids',title:'ids',width:100,align:'center',hidden:true},
								{field:'weight',title:'本次体重',width:100,align:'center'},
								{field:'lastweight',title:'体重变化',width:100,align:'center',
									formatter: function(value,row,index){
										var js =  parseFloat(row.weight)- parseFloat(row.lastweight);
										js = js.toFixed(1);
										if(js<0){
											
											return  "<span  style='color:green'>" + "掉秤"+(-js) + "<span>";
										}else if(js == 0){
											return "<span  style='color:#00CCFF'>" +js + "<span>";
										}else{
											return  "<span  style='color:red'>" +"涨称"+js + "<span>"
										}
									}	},
								{field:'starttime',title:'开始时间',width:200,align:'center'},
								{field:'endtime',title:'结束时间',width:200,align:'center'},
								{field:'plasterCount',title:'是否药贴',width:100,align:'center',
									formatter: function(value,row,index){
										if(row.plasterCount == 1){
											return '是';
										}else{
											return '否';
										}
									}	
								},
								{field:'plasterservier',title:'手法人员',width:120,align:'center'},
								/* {field:'isshaping',title:'是否塑形',width:100,align:'center',
									formatter: function(value,row,index){
										if(row.isshaping == 1){
											var customerIds = '${customerIds! }';
											var serviceIds = row.ids;
											return '<a href="#" style="color: blue;" class="button-edit" onclick="lookServiceDetail(\'' + serviceIds + '\')">查看详情</a>';
										}else{
											return '否';
										}
									}	
								}, */
								/* {field:'partsize',title:'部位尺寸',width:100,align:'center',
									formatter: function(value,row,index){
										var ids = row.ids;
										var date = row.date;
										var customerIds = '${customerIds! }';
										var url = '${cxt!}/customerInfoStatistic/toLookCustomerPartSize?serviceIds=' + ids + '&date=' + date + '&customerIds=' + customerIds;
										return '<a href="#" style="color: blue;" class="button-edit" onclick="lookPartSize(\'' + url + '\')">查看详情</a>';
									}	
								}, */
								
								
								{field:'yb',title:'腰部',width:120,align:'center'},
								{field:'dt',title:'大腿',width:120,align:'center'},
								{field:'xt',title:'小腿',width:120,align:'center'},
								{field:'gb',title:'胳膊',width:120,align:'center'}
						    ]]
				})
			}
			
		
			
		/* 	//查看明细
			function lookServiceDetail(ids){
				//alert(ids);				

				//alert(startTime);
				loadViewDialog('查看塑形详情', '${cxt!}/customerInfoStatistic/toLookCustomerServiceDetail?serviceIds=' + ids);
			}
			
			//查看部位尺寸
			function lookPartSize(url){
				loadViewDialog('查看塑形详情', url);
			} */
		</script>
		
		</body>
</html>	
			